<!DOCTYPE html>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>1-3 鼠标移入移出时间</title>
	<style>
		*{
			margin: 0;
			padding: 0;
		}
		.hezi{
			width: 200px;
			height: 200px;
			background-color: white;
			border: 10px solid red;
			margin: 50px auto;
			text-align: center;
			line-height: 200px;
			font-size: 20px;
		}
	</style>
	<script type="text/javascript">
		window.onload=function(){
			var oDiv=document.querySelector('.hezi');
			oDiv.onmouseenter=function(){
				oDiv.style.backgroundColor="black";
				oDiv.style.border="20px solid green";
				oDiv.innerText="鼠标已移入";
				oDiv.style.color="white";
			}
			oDiv.onmouseleave=function(){
				oDiv.style.backgroundColor="white";
				oDiv.style.border="10px solid red";
				oDiv.innerText="鼠标已移出";
				oDiv.style.color="black";
			}
		};
	</script>
</head>
<body>
	<div class="hezi">鼠标移入移出</div>
</body>
</html>